DECLARE SUB Stats ()
DECLARE SUB Apartment ()
DECLARE SUB ApartmentComplex ()
DECLARE SUB CannotGo ()
DECLARE SUB CannotDo ()
DECLARE SUB Help ()
DECLARE SUB Inventory ()
DECLARE SUB Quit ()
DECLARE SUB RestoreInGame ()
DECLARE SUB SaveGame ()
'$INCLUDE: 'c:\bc7\programs\cyber\global.bi'

SUB Elevator1

RestoreRoom = 10
Room:
  CLS
  PRINT "You are standing inside a small elevator inside the apartment complex.  There"
  PRINT "are no floor buttons, just a small panel with writing and a slot.  The doors"
  PRINT "open to the east."
Command:
  LINE INPUT "> "; a$: a$ = UCASE$(a$)
  IF a$ = "N" OR a$ = "NORTH" OR a$ = "GO NORTH" THEN CannotGo: GOTO Command
  IF a$ = "S" OR a$ = "SOUTH" OR a$ = "GO SOUTH" THEN CannotGo: GOTO Command
  IF a$ = "E" OR a$ = "EAST" OR a$ = "GO EAST" THEN GOTO ExitElevator
  IF a$ = "W" OR a$ = "WEST" OR a$ = "GO WEST" THEN CannotGo: GOTO Command
  IF a$ = "STATS" THEN Stats: GOTO Command
  IF a$ = "SEARCH" OR a$ = "SEARCH ROOM" THEN GOTO SearchRoom: GOTO Command
  IF a$ = "LOOK" THEN GOTO Room: GOTO Command
  IF a$ = "HELP" OR a$ = "?" THEN Help: GOTO Room
  IF a$ = "QUIT" OR a$ = "EXIT" THEN Quit: GOTO Command
  IF a$ = "I" OR a$ = "INVENTORY" THEN Inventory: GOTO Command
  IF a$ = "SAVE" OR a$ = "SAVE GAME" THEN SaveGame: GOTO Command
  IF a$ = "RESTORE" OR a$ = "RESTORE GAME" THEN RestoreInGame: GOTO Command
  IF a$ = "READ WRITING" OR a$ = "LOOK WRITING" OR a$ = "READ PANEL" OR a$ = "LOOK PANEL" THEN PRINT "It reads: INSERT APARTMENT KEY.": GOTO Command
  IF a$ = "INSERT KEY" OR a$ = "INSERT APARTMENT KEY" OR a$ = "USE KEY" OR a$ = "USE APARTMENT KEY" THEN GOTO ChangeFloors
  CannotDo
  GOTO Command

SearchRoom:
  PRINT "You find nothing of note."
  GOTO Command

ExitElevator:
  IF ApartmentFloor = 1 THEN ApartmentComplex
  Apartment

ChangeFloors:
  IF ApartmentKey = 0 THEN PRINT "You don't have that item.": GOTO Command
  IF ApartmentFloor = 1 THEN ApartmentFloor = 2 ELSE ApartmentFloor = 1
  IF ApartmentFloor = 1 THEN PRINT "The elevator quickly arrives at the lobby and the doors slide open."
  IF ApartmentFloor = 2 THEN PRINT "The elevator quickly arrives at your apartment and the doors slide open."
  GOTO Command

END SUB

